/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.infinityk.simplesoundengine.test;

import com.infinityk.simplesoundengine.SimpleSoundEngine;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Asier
 */
class PollWorker extends Thread{
    private SimpleSoundEngine engine;

    public PollWorker(SimpleSoundEngine engine) {
        super("PollWorker");
        this.engine = engine;
    }
    
    @Override
    public void run(){
        while(!interrupted()){
            engine.poll();
            try {
                Thread.sleep(50);
            } catch (InterruptedException ex) {
                Logger.getLogger(PollWorker.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    
}
